<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String basePath= request.getScheme()+
            "://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";
%>
<html>
<head>
    <title>Title</title>
<%--    <base href="http://localhost:8080/my06_path/">--%>
    <%--动态获取路径--%>
    <base href="<%=basePath%>">
</head>
<body>
    <p>当出来方法返回ModelAndView实现forward</p>
    <form action="doForward.do" method="post">
        姓名：<input type="text" name="name"><br>
        年龄：<input type="text" name="age"><br>
        <input type="submit" value="提交请求">
    </form>
    <hr>
    <p>当出来方法返回ModelAndView实现redirect</p>
    <form action="doRedirect.do" method="post">
        姓名：<input type="text" name="name"><br>
        年龄：<input type="text" name="age"><br>
        <input type="submit" value="提交请求">
    </form>
</body>
</html>
